package operation;
import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class BoorOpeartion implements Ioperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("请输入你要借的书名");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();
        int currrent= bookList.getUseSize();
        for (int i = 0; i < currrent; i++) {
            Book book=bookList.getBook(i);
            if(book.getName().equals(name)){
                book.setBoorowed(true);
                System.out.println("借阅图书");
                System.out.println("成功接借出");
                return;
            }
        }
        System.out.printf("没有你要借的图书"+name);
    }
}
